// 预算管理类
public class BudgetManager {
    private double budget;

    public void setBudget(double budget) {
        if (budget < 0) {
            System.out.println("错误：预算金额不能为负数！");
            return;
        }
        this.budget = budget;
        System.out.println("预算已设置为: " + budget);
    }

    public double getBudget() {
        return budget;
    }

    public double calculateRemainingBudget(PersonalBillManager.ExpenseManager expenseManager) {
        double totalExpense = expenseManager.getExpenses().stream().mapToDouble(bill -> bill.amount).sum();
        return budget - totalExpense;
    }
}
